<template>
  <div id="ResultSearch">
    <el-table :data="tableData" style="width: 100%" stripe border>
      <el-table-column
        :prop="item"
        :label="item"
        v-for="(item, index) in titles"
        :key="index * 10"
      />
    </el-table>
  </div>
</template>

<script>
import { getSearchData } from 'network/search'
export default {
  name: 'ResultSearch',
  data() {
    return {
      tableData: [],
      titles: []
    }
  },

  created() {
    getSearchData(this.$route.params.form).then(res => {
      console.log(res.data)
      this.tableData = res.data
      this.titles = Object.keys(res.data[0])
    })
  }
}
</script>

<style  scoped>
</style>